package com.csx.data.sample.security.impl;


import com.csx.data.sample.security.DBSecurity;
import com.csx.data.sample.util.EncryptUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 默认实现
 *
 * @author zsc zhangshuanchao@sunline.cn 2018/12/11.
 */
public class DefaultDBSecurity implements DBSecurity {

    private static final Logger logger = LoggerFactory.getLogger(DefaultDBSecurity.class);
    @Override
    public String decrypt(String password) {
        try {
            password = EncryptUtils.decrypt(password);
        } catch (Exception e) {
            logger.error("decrypt DB config failed !", e);
        }
        return password;
    }
}
